package com.ly.lypicturebackend.exception;

/**
 * @author luyi
 * @date 2024/12/19 0:44
 */
public class ThrowUtil {
    public static void throwIf(boolean condition,RuntimeException runtimeException) {
        if(condition) {
            throw runtimeException;
        }
    }
    public static void throwIf(boolean condition,ErrorCode errorCode) {
        throwIf(condition,new BusinessException(errorCode));
    }
    public static void throwIf(boolean condition,ErrorCode errorCode,String message) {
        throwIf(condition,new BusinessException(errorCode,message));
    }

}
